package com.kaiwukj.android.ufamily.mvp.http.api.service;

import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseObjResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommunityInfoResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommunityResult;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface CommunityService {


    @GET("/estate/app/committee/communityIntroduction")
    Observable<BaseObjResp<CommunityInfoResult>> getCommunityInfo(@Query("commId") Integer communityId);

    @PUT("/admin/app/userAccount/changeCommunity/{communityId}")
    Observable<BaseObjResp<Void>> updateCommunity(@Path("communityId") int communityId);

    @GET("/admin/app/userAccount/getNearbyCommunty")
    Observable<BaseListResp<CommunityResult>> fetchCommunity(@Query("myLatitude") double latitude,
                                                             @Query("myLongitude") double longitude,
                                                             @Query("pageSize") int pageSize);

    @GET("/admin/app/userConmmunity/page")
    Observable<BaseListResp<CommunityResult>> fetchCommunityByKeyword(@Query("communityName") String communityName,
                                                                      @Query("pageSize") int pageSize);
}
